/*
 * BPlusTree.h
 *
 *  Created on: 16-Oct-2013
 *      Author: sriram
 */

#ifndef BPLUSTREE_H_
#define BPLUSTREE_H_
#include "BPlusTreeNode.h"
#include "../dependency/GlobalStructures.h"
#include "../dependency/StatusCodes.h"
#include "../dependency/GlobalDefines.h"
class BPlusTree {
private:
	IndexHeaderPage *indexHeaderPage_;

public:
	BPlusTree();
	BPlusTree(int indexHeaderPageNumber);
	virtual ~BPlusTree();
	STATUS_CODE insert(char *key, RIDStruct &rid);
        STATUS_CODE remove(char *key, RIDStruct &rid);
        int getFirstLeafPage();
        STATUS_CODE search(char *key1, char *key2, vector<RIDStruct> &arrRid);
        STATUS_CODE search(char *key, vector<RIDStruct>& arrRid);
        STATUS_CODE search(char *key, int operatorType, vector<RIDStruct>& arrRid);
        STATUS_CODE search(char *key, vector<int> arrOperatorType, vector<RIDStruct>& arrRid);
        int search(char *key);
        int search(char *key, int noColumns);
        int insertsearch(char *key);
        void levelOrderTraverse();
        bool checkConsistency();
        //void displayBPlusTree();
};

#endif /* BPLUSTREE_H_ */
/*
 * Things to do:
 * 1. Delete in BPlusTree
 * 2. Delete in BPlusTreeLeafNode
 * 3. Delete in BPlusTreeNode
 
 */